/*
 * @Description: 
 * @Author: paddies
 * @Date: 2024-06-03 15:04:42
 * @LastEditors: paddies
 * @LastEditTime: 2024-06-03 15:16:57
 * @FilePath: /shared_components/lib/build-tab-list/controller.dart
 */
import 'package:get/get.dart';
import 'package:shared_components/build-tab-list/state.dart';

class BuildTabListController extends GetxController {
  final BuildTabListState state = BuildTabListState();

  changeTab({int index = 0}) {
    print("切换");
    state.tabIndex.value = index;
    print(state.tabIndex.value);
    var list = state.tabList.value[index]["list"] as List;
    if (list.length == 0) {
      // nextPage();
    }
  }

  getAllCountName() {
    var count = state.allCount.value;
    if (count > 99) {
      return '99+';
    }
    return count.toString();
  }

  @override
  void onInit() {
    // TODO: implement onInit
    super.onInit();
  }
}
